home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Networking / OTStreamLogViewer / IC Libraries / ICDebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  803 b   |  23 lines  |  [TEXT/CWIE]

  1. /*    This file is part of the Internet Configuration system and is placed in the public domain for the benefit of all.
  2.  
  3.     Useful debugging macros and such.
  4. */
  5.  
  6. #ifndef icDebug
  7.     #define icDebug 0
  8. #endif
  9.  
  10. #if icDebug
  11.     #define ICAssert(mustBeTrue)    \
  12.             do { if ( ! (mustBeTrue) ) { DebugStr("\pICAssert: Assertion failed! ; sc"); } } while (0)
  13.     #define ICDebugStr(message)    \
  14.             DebugStr("\p" ## message)
  15.     #define ICParamCheck(err, mustBeTrue, message) \
  16.             do { if (err == noErr && ! (mustBeTrue)) { DebugStr("\pICParamCheck: " ## message ## "; sc"); err = paramErr; } } while (0)
  17. #else
  18.     #define ICAssert(mustBeTrue)     /* nothing */
  19.     #define ICDebugStr(message)     /* nothing */
  20.     #define ICParamCheck(err, mustBeTrue, message) \
  21.             do { if (err == noErr && ! (mustBeTrue)) { err = paramErr; } } while (0)
  22. #endif
  23.